package club.janna.jrpc.cluster.loadbalance.selector;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 抽象轮询选择器
 * @author Panbo.Guo
 */
public abstract class AbstractRoundSelector implements Selector {
    private final AtomicInteger counter = new AtomicInteger(0);

    protected abstract int next(int count);

    @Override
    public int next() {
        return next(counter.incrementAndGet());
    }
}
